﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Threading;

namespace Client.ViewModel
{
    public class BaseViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string propertyName) {
            if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 
        }

        private Dispatcher _dispatcher;
        protected Dispatcher Dispatcher
        {
            get { return _dispatcher; }
        }

        public BaseViewModel()
        {
            _dispatcher = Dispatcher.CurrentDispatcher;
        }
    }
}